Skip to content

Update model inspector documentation - #24

Merged
crowbat merged 1 commit into
apple:mainfrom
crowbat:u/k_hsieh/update_model_inspector_docs_and_minor_updates
Jul 10, 2026
Merged

Update model inspector documentation#24
crowbat merged 1 commit into
apple:mainfrom
crowbat:u/k_hsieh/update_model_inspector_docs_and_minor_updates

Conversation

@crowbat

@crowbat crowbat commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
  • Minor updates to eager mode model inspector

@crowbat
crowbat requested review from dengqiaoyu and u-simha July 1, 2026 19:31
@crowbat
crowbat force-pushed the u/k_hsieh/update_model_inspector_docs_and_minor_updates branch from 7bc9c01 to 6008c27 Compare July 1, 2026 20:05

@u-simha u-simha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a doc preview? Would make it much easier to look at the flow and review


- **Graph mode** (`execution_mode="graph"`): Exports the model with `torch.export` and walks the resulting FX graph. Op names are global identifiers assigned during export (for example, `"linear"`, `"linear_1"`). The compressor must be `Quantizer` or `None`.
- **Eager mode** (`execution_mode="eager"`): Intercepts operations during a live forward pass. Op names are module-qualified identifiers that reflect the module hierarchy (for example, `"linear1.linear"`, `"linear2.linear"`). This mode supports both `Quantizer` and `KMeansPalettizer` as the compressor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should link to the section that explains the differences between Graph & Eager here

https://apple.github.io/coreai-optimization/quantization/overview.html#two-execution-modes-graph-and-eager

Note the use of `compressor=Quantizer` in the list of arguments to `ModelInspector`. This filters the list of ops captured and displayed by `ModelInspector` to only those operations which are registered for compressibility by `Quantizer`. Omitting this argument allows for all ops to be captured and displayed.
Pass `colorize=False` to suppress ANSI color codes, for example when writing to a file.

Note the use of `compressor=Quantizer`. This filters the captured and displayed ops to those registered as compressible by `Quantizer`. Omit this argument to capture and display all ops.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest using the

:::{note}

to call out this section

@crowbat
crowbat force-pushed the u/k_hsieh/update_model_inspector_docs_and_minor_updates branch from 6008c27 to 8dc9c47 Compare July 6, 2026 17:45
- Minor updates to eager mode model inspector
@crowbat
crowbat force-pushed the u/k_hsieh/update_model_inspector_docs_and_minor_updates branch from 8dc9c47 to 886d7e0 Compare July 10, 2026 01:18
@crowbat
crowbat merged commit 4968b10 into apple:main Jul 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants